{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[44, 41, 36, 32]  ->  [44, 41, 40, 36, 32]\n",
      "[58, 18, 25, 20]  ->  [58, 50, 18, 25, 20]\n",
      "[58, 18, 28, 37]  ->  [58, 50, 18, 28, 37]\n",
      "[36, 41, 37]  ->  [36, 40, 41, 37]\n",
      "[23, 17, 46]  ->  [23, 17, 28, 46]\n",
      "[53, 55, 31]  ->  [53, 54, 55, 31]\n",
      "[55, 53, 52, 48, 58]  ->  [55, 54, 53, 52, 48, 58]\n",
      "[55, 22, 21, 18, 58]  ->  [55, 22, 21, 18, 50, 58]\n",
      "[55, 22, 23, 18, 58]  ->  [55, 22, 23, 18, 50, 58]\n",
      "[23, 17, 46]  ->  [23, 17, 28, 46]\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "[5.0, 8, 4.0]"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import json\n",
    "from QKDNetwork import QKDNetwork\n",
    "from compare_hybrid import Compare\n",
    "import concurrent.futures\n",
    "import sys\n",
    "\n",
    "# 节点个数： 20-210          默认：60      迭代：20 + cnt * 10\n",
    "# 源目对数： 10-200          默认：50      迭代：10 + cnt * 10\n",
    "# 阿尔法值： 0.35-1.3        默认：0.2     迭代：0.2 + cnt * 0.05\n",
    "max_workers = 60\n",
    "mean_round = 60\n",
    "\n",
    "def experiment(num_node, sd_num, alpha):\n",
    "    try:\n",
    "        q = QKDNetwork(showTopology=False, num_node=num_node, sd_num=sd_num, alpha=alpha, hete=False, hybrid=True)\n",
    "        q.getCandidatePathsWithMDI()\n",
    "        c = Compare(q)\n",
    "        tmp = c.getData()\n",
    "        return tmp\n",
    "    except Exception as e:\n",
    "        print(\"No Feasible, Pass\")\n",
    "        return [0, 0, 0]\n",
    "    \n",
    "experiment(60, 50, 0.45)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "pass"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "xs",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.16"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
